#ifndef THRESHOLDDIALOG_H
#define THRESHOLDDIALOG_H

#include <QDialog>
#include "histomgram.h"

namespace Ui {
class ThresholdDialog;
}

class ThresholdDialog : public QDialog
{
    Q_OBJECT
    
public:
    explicit ThresholdDialog(QWidget *parent = 0);
    ~ThresholdDialog();

    void setThreshold(int threshold);
    void setGrayInfo(int* grayInfo);

signals:
    void threshold1Changed(int);
    void threshold2Changed(int);
    void applyOperator(QString);
    void cancelOperator();

protected:
    void paintEvent(QPaintEvent *);
    void closeEvent(QCloseEvent *);

private:
    Ui::ThresholdDialog *ui;

    int m_grayInfo[256];
    Histomgram m_histomgram;

private slots:
    void updateThreshold1(int);
    void updateThreshold2(int);
    void applyButtonClicked();
    void cancelButtonClicked();
};

#endif // THRESHOLDDIALOG_H
